<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%     
	String path = request.getContextPath();     
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";     
%>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>查看</title>
    <base href="<%=basePath%>"/>
    <link rel="stylesheet" type="text/css" href="css/common.css" />
    <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="js/common.js"></script>
    <link rel="stylesheet" href="<%=basePath%>/js/jquery-tablesorter/themes/blue/style.css" type="text/css" media="print, projection, screen" />
    <script type="text/javascript" src="<%=basePath%>/js/jquery-tablesorter/jquery.tablesorter.min.js"></script>
    <style type="text/css">
  		fieldset,legend,form,table,tr,td,textarea{margin:0;padding:0}
  		form label {font-weight:bold;}
    	table{margin:10px 10px};
  		td{line-height: 40px;}
		input[type="text"]{width:250px;}
		input[type="password"]{width:250px;}
		input[type="textarea"]{width:250px;}   		
		select {width:100px;}
    </style>
    
	<script type="text/javascript">
	  $(document).ready(function(){
		  
			$(".tablesorter").tablesorter({
	       		headers:{0:{sorter:false},
	       			1:{sorter:false}},
	       			widgets: ['zebra']
	       	});
	  });
	  
	  function backList(){
		  var size = $("#size").val();
	      location.href = "<%=basePath%>manage/etl?act=getPage&size="+size;
		   }
	  function init(){
		  $(":text").attr("disabled",true);
		  $("select").attr("disabled",true);
	  }
	</script>    
  </head>
  
  <body onload="init()">
  <div>
    <fieldset>
      <legend>查看EtlEntity：</legend>
      	<input type="hidden" id="size" name="size" value="${size }" />
      	<p id = "p_error" style = "margin:10px 10px;">
      	    <label id="error_label" style="color:red;"></label>
      	</p>
        <table>
          <tr>
            <td><label for="name">实例模式名：</label></td>
            <td>
            	<input type="text" name="entitySchema" id="entitySchema" value="${entity.entitySchema }" />
            	<font color="red">&nbsp;*&nbsp;&nbsp;</font>
            </td>
            <td><label for="name">实例名：</label></td>
            <td>
            	<input type="text" name="entityName" id="entityName" value="${entity.entityName }" />
            	<font color="red">&nbsp;*&nbsp;&nbsp;</font>
            </td>
            <td><label for="name">调度周期：</label></td>
            <td>
            	<select name="runCycle" id="runCycle" >
            		<option value="D" <c:if test="${entity.runCycle=='D' }">selected</c:if> >日</option>
            		<option value="M" <c:if test="${entity.runCycle=='M' }">selected</c:if> >月</option>
            		<option value="W" <c:if test="${entity.runCycle=='W' }">selected</c:if> >周</option>
            		<option value="Q" <c:if test="${entity.runCycle=='Q' }">selected</c:if> >季</option>
            		<option value="Y" <c:if test="${entity.runCycle=='Y' }">selected</c:if> >年</option>
            	</select>
            	<font color="red">&nbsp;*&nbsp;&nbsp;</font>
            </td>
         </tr>
         <tr>
            <td><label for="name">调度月份：</label></td>
            <td>
            	<input type="text" name="runMonth" id="runMonth" onfocus="WdatePicker({dateFmt:'MM'})" value="${entity.runMonth }" class="Wdate"  />
            	<font color="red">&nbsp;*&nbsp;&nbsp;</font>
            </td>
            <td><label for="name">调度日期：</label></td>
            <td>
            	<input type="text" name="runDay" id="runDay" onfocus="WdatePicker({dateFmt:'dd'})"  value="${entity.runDay }" class="Wdate"  />
            	<font color="red">&nbsp;*&nbsp;&nbsp;</font>
            </td>
            <td><label for="name">调度小时：</label></td>
            <td>
            	<input type="text" name="endHour" id="endHour" onfocus="WdatePicker({dateFmt:'HH'})"  value="${entity.endHour }" class="Wdate"  />
            	<font color="red">&nbsp;*&nbsp;&nbsp;</font>
            </td>
         </tr>
         <tr>
            <td><label for="name">调度分钟：</label></td>
            <td>
            	<input type="text" name="runMinutes" id="runMinutes" onfocus="WdatePicker({dateFmt:'mm'})" value="${entity.runMinutes }" class="Wdate"  />
            	<font color="red">&nbsp;*&nbsp;&nbsp;</font>
            </td>
	  		<td><label for="name">作者：</label></td>
            <td>
            	<input type="text" name="author" id="author" value="${entity.author }" />
            	<font color="red">&nbsp;*&nbsp;&nbsp;</font>
            </td>
            <td><label for="name">是否参与调度：</label></td>
            <td>
            	<select name="runEnable" id="runEnable">
            		<option value="0">不参与</option>
            		<option value="1">参与</option>
            	</select>
            	<font color="red">&nbsp;*&nbsp;&nbsp;</font>
            </td>
          	<td></td>
            <td>
            	<input type="button" id="btn_back" value="返回" onclick="backList()" style="width:80px;" />
            </td>
          </tr>
        </table>
    </fieldset>
  </div>    
  <div>
  <fieldset>
      <legend>脚本列表：</legend>
      <table id="resultTable"  class="tablesorter">
     <thead>
          <tr>
              <th width="150px;">脚本序列</th>
              <th width="250px;">脚本内容</th>
              <th width="150px;">出错是否跳过</th>
              <th width="150px;">创建时间</th>
              <th width="150px;">修改时间</th>
              <th width="150px;">模式名</th>
              <th width="150px;">实体名</th>
          </tr>
          </thead>
          <c:forEach items="${scriptList}" var="script" varStatus="status">
          <tr>
		  	  <td>${script.scriptSeq }</td>
		  	  <td style="white-space: nowrap;">${script.scriptStr }</td>
		  	  <td>${script.errorPast }</td>
		  	  <td>${script.createDate }</td>
		  	  <td>${script.updateDate }</td>
		  	  <td>${script.entitySchema }</td>
		  	  <td>${script.entityName }</td>
          </tr>
          </c:forEach>
    </table>
  </fieldset>
  </div>
   <div>
   <fieldset>
      <legend>依赖列表：</legend>
      <table id="resultTable"  class="tablesorter">
     <thead>
          <tr>
              <th width="150px;">实例ID</th>
              <th width="250px;">实例名称</th>
              <th width="150px;">依赖实例名称</th>
          </tr>
          </thead>
          <c:forEach items="${depList}" var="dep" varStatus="status">
          <tr>
		  	  <td>${dep.entityId }</td>
		  	  <td>${dep.entityName }</td>
		  	  <td>${dep.dependentName }</td>
          </tr>
          </c:forEach>
    </table>
   </fieldset>
  </div>
  </body>
</html>